* Deprecate navicache.
mtk_locus.cc
mtk_logger.cc
mynav.cc
- navicache.cc
navilink.cc
navitel.cc
osm.cc
mtk_locus.cc \
mtk_logger.cc \
mynav.cc \
- navicache.cc \
navilink.cc \
navitel.cc \
osm.cc \
--- /dev/null
+/*
+ Copyright (C) 2003-2013 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ */
+#include "defs.h"
+#include "cet_util.h"
+#include "src/core/file.h"
+#include <QXmlStreamReader>
+
+static char* noretired = nullptr;
+static QString read_fname;
+
+static
+QVector<arglist_t> nav_args = {
+ {
+ "noretired", &noretired, "Suppress retired geocaches",
+ nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
+ },
+};
+
+#define MYNAME "navicache"
+#define NC_URL "http://www.navicache.com/cgi-bin/db/displaycache2.pl?CacheID="
+
+static struct
+ nc_type_mapping {
+ geocache_type type;
+ const char* name;
+} nc_type_map[] = {
+ { gt_unknown, "unknown" },
+ { gt_traditional, "normal" },
+ { gt_multi, "Multi-part" },
+ { gt_virtual, "Virtual" },
+ { gt_event, "event" }
+};
+
+static struct
+ nc_container_mapping {
+ geocache_container type;
+ const char* name;
+} nc_container_map[] = {
+ { gc_other, "Unknown" },
+ { gc_micro, "Micro" },
+ { gc_regular, "Normal" },
+ { gc_large, "Large" },
+ { gc_virtual, "Virtual" }
+};
+
+static
+geocache_type
+nc_mktype(const QString& t)
+{
+ int sz = sizeof(nc_type_map) / sizeof(nc_type_map[0]);
+
+ for (int i = 0; i < sz; i++) {
+ if (0 == t.compare(nc_type_map[i].name, Qt::CaseInsensitive)) {
+ return nc_type_map[i].type;
+ }
+ }
+ return gt_unknown;
+}
+
+static
+geocache_container
+nc_mkcont(const QString& t)
+{
+ int sz = sizeof(nc_container_map) / sizeof(nc_container_map[0]);
+
+ for (int i = 0; i < sz; i++) {
+ if (0 == t.compare(nc_container_map[i].name, Qt::CaseInsensitive)) {
+ return nc_container_map[i].type;
+ }
+ }
+ return gc_unknown;
+}
+
+static void
+nav_rd_init(const QString& fname)
+{
+ read_fname = fname;
+}
+
+static void
+NaviReadCache(const QXmlStreamReader& reader)
+{
+ const QXmlStreamAttributes a = reader.attributes();
+ auto* wpt_tmp = new Waypoint;
+ geocache_data* gc_data = wpt_tmp->AllocGCData();
+ if (a.hasAttribute("cache_id")) {
+ int n = a.value("cache_id").toString().toInt();
+ QString fn = QString("N%1").arg(n, 5, 16, QChar('0'));
+ wpt_tmp->shortname = fn;
+
+ UrlLink l(QString(NC_URL) + QString::number(n));
+ wpt_tmp->AddUrlLink(l);
+ }
+ if (a.hasAttribute("name")) {
+ wpt_tmp->description = a.value("name").toString();
+ }
+ if (a.hasAttribute("user_name")) {
+ gc_data->placer = a.value("user_name").toString();
+ }
+
+ if (a.hasAttribute("latitude")) {
+ wpt_tmp->latitude = a.value("latitude").toString().toDouble();
+ }
+ if (a.hasAttribute("longitude")) {
+ wpt_tmp->longitude = a.value("longitude").toString().toDouble();
+ }
+
+ if (a.hasAttribute("difficulty")) {
+ gc_data->diff = a.value("difficulty").toString().toDouble() * 10;
+ }
+ if (a.hasAttribute("terrain")) {
+ gc_data->terr = a.value("terrain").toString().toDouble() * 10;
+ }
+
+ if (a.hasAttribute("cache_type")) {
+ QString t = a.value("cache_type").toString();
+ gc_data->type = nc_mktype(t);
+ if (t == "normal") {
+ wpt_tmp->icon_descr = "Geocache-regular";
+ } else if (t == "multi-part") {
+ wpt_tmp->icon_descr = "Geocache-multi";
+ } else if (t == "moving_travelling") {
+ wpt_tmp->icon_descr = "Geocache-moving";
+ } else {
+ wpt_tmp->icon_descr = QString("Geocache-%-%1").arg(t);
+ }
+ }
+
+ if (a.hasAttribute("hidden_date")) {
+ QString h = a.value("hidden_date").toString();
+ QDateTime hd = QDateTime::fromString(h, "yyyy-MM-dd");
+ wpt_tmp->SetCreationTime(hd);
+ }
+
+ if (a.hasAttribute("retired")) {
+ if (a.value("terrain").toString() == "yes" && noretired) {
+ delete wpt_tmp;
+ return;
+ }
+ }
+
+ if (a.hasAttribute("cache_size")) {
+ gc_data->container = nc_mkcont(a.value("cache_size").toString());
+ }
+
+ if (a.hasAttribute("description")) {
+ gc_data->desc_long.is_html = true;
+ gc_data->desc_long.utfstring = a.value("description").toString();
+ }
+
+ if (a.hasAttribute("comments")) {
+ gc_data->desc_short.is_html = true;
+ gc_data->desc_short.utfstring = a.value("comments").toString();
+ }
+
+
+ waypt_add(wpt_tmp);
+}
+
+static void
+nav_read()
+{
+ QXmlStreamReader reader;
+ gpsbabel::File file(read_fname);
+ file.open(QIODevice::ReadOnly);
+ reader.setDevice(&file);
+
+ while (!reader.atEnd()) {
+ if (reader.tokenType() == QXmlStreamReader::StartElement) {
+ if (reader.name() == u"CacheDetails") {
+ NaviReadCache(reader);
+ }
+ }
+ reader.readNext();
+ }
+ if (reader.hasError()) {
+ fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
+ qPrintable(reader.errorString()),
+ qPrintable(file.fileName()),
+ (long) reader.lineNumber(),
+ (long) reader.columnNumber());
+ }
+}
+
+static void
+nav_rd_deinit()
+{
+}
+
+ff_vecs_t navicache_vecs = {
+ ff_type_file,
+ { ff_cap_read, ff_cap_none, ff_cap_none },
+ nav_rd_init,
+ nullptr,
+ nav_rd_deinit,
+ nullptr,
+ nav_read,
+ nullptr,
+ nullptr,
+ &nav_args,
+ CET_CHARSET_UTF8, 0 /* CET-REVIEW */
+ , NULL_POS_OPS,
+ nullptr
+};
+++ /dev/null
-/*
- Copyright (C) 2003-2013 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-#include "defs.h"
-#include "cet_util.h"
-#include "src/core/file.h"
-#include <QXmlStreamReader>
-
-static char* noretired = nullptr;
-static QString read_fname;
-
-static
-QVector<arglist_t> nav_args = {
- {
- "noretired", &noretired, "Suppress retired geocaches",
- nullptr, ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
- },
-};
-
-#define MYNAME "navicache"
-#define NC_URL "http://www.navicache.com/cgi-bin/db/displaycache2.pl?CacheID="
-
-static struct
- nc_type_mapping {
- geocache_type type;
- const char* name;
-} nc_type_map[] = {
- { gt_unknown, "unknown" },
- { gt_traditional, "normal" },
- { gt_multi, "Multi-part" },
- { gt_virtual, "Virtual" },
- { gt_event, "event" }
-};
-
-static struct
- nc_container_mapping {
- geocache_container type;
- const char* name;
-} nc_container_map[] = {
- { gc_other, "Unknown" },
- { gc_micro, "Micro" },
- { gc_regular, "Normal" },
- { gc_large, "Large" },
- { gc_virtual, "Virtual" }
-};
-
-static
-geocache_type
-nc_mktype(const QString& t)
-{
- int sz = sizeof(nc_type_map) / sizeof(nc_type_map[0]);
-
- for (int i = 0; i < sz; i++) {
- if (0 == t.compare(nc_type_map[i].name, Qt::CaseInsensitive)) {
- return nc_type_map[i].type;
- }
- }
- return gt_unknown;
-}
-
-static
-geocache_container
-nc_mkcont(const QString& t)
-{
- int sz = sizeof(nc_container_map) / sizeof(nc_container_map[0]);
-
- for (int i = 0; i < sz; i++) {
- if (0 == t.compare(nc_container_map[i].name, Qt::CaseInsensitive)) {
- return nc_container_map[i].type;
- }
- }
- return gc_unknown;
-}
-
-static void
-nav_rd_init(const QString& fname)
-{
- read_fname = fname;
-}
-
-static void
-NaviReadCache(const QXmlStreamReader& reader)
-{
- const QXmlStreamAttributes a = reader.attributes();
- auto* wpt_tmp = new Waypoint;
- geocache_data* gc_data = wpt_tmp->AllocGCData();
- if (a.hasAttribute("cache_id")) {
- int n = a.value("cache_id").toString().toInt();
- QString fn = QString("N%1").arg(n, 5, 16, QChar('0'));
- wpt_tmp->shortname = fn;
-
- UrlLink l(QString(NC_URL) + QString::number(n));
- wpt_tmp->AddUrlLink(l);
- }
- if (a.hasAttribute("name")) {
- wpt_tmp->description = a.value("name").toString();
- }
- if (a.hasAttribute("user_name")) {
- gc_data->placer = a.value("user_name").toString();
- }
-
- if (a.hasAttribute("latitude")) {
- wpt_tmp->latitude = a.value("latitude").toString().toDouble();
- }
- if (a.hasAttribute("longitude")) {
- wpt_tmp->longitude = a.value("longitude").toString().toDouble();
- }
-
- if (a.hasAttribute("difficulty")) {
- gc_data->diff = a.value("difficulty").toString().toDouble() * 10;
- }
- if (a.hasAttribute("terrain")) {
- gc_data->terr = a.value("terrain").toString().toDouble() * 10;
- }
-
- if (a.hasAttribute("cache_type")) {
- QString t = a.value("cache_type").toString();
- gc_data->type = nc_mktype(t);
- if (t == "normal") {
- wpt_tmp->icon_descr = "Geocache-regular";
- } else if (t == "multi-part") {
- wpt_tmp->icon_descr = "Geocache-multi";
- } else if (t == "moving_travelling") {
- wpt_tmp->icon_descr = "Geocache-moving";
- } else {
- wpt_tmp->icon_descr = QString("Geocache-%-%1").arg(t);
- }
- }
-
- if (a.hasAttribute("hidden_date")) {
- QString h = a.value("hidden_date").toString();
- QDateTime hd = QDateTime::fromString(h, "yyyy-MM-dd");
- wpt_tmp->SetCreationTime(hd);
- }
-
- if (a.hasAttribute("retired")) {
- if (a.value("terrain").toString() == "yes" && noretired) {
- delete wpt_tmp;
- return;
- }
- }
-
- if (a.hasAttribute("cache_size")) {
- gc_data->container = nc_mkcont(a.value("cache_size").toString());
- }
-
- if (a.hasAttribute("description")) {
- gc_data->desc_long.is_html = true;
- gc_data->desc_long.utfstring = a.value("description").toString();
- }
-
- if (a.hasAttribute("comments")) {
- gc_data->desc_short.is_html = true;
- gc_data->desc_short.utfstring = a.value("comments").toString();
- }
-
-
- waypt_add(wpt_tmp);
-}
-
-static void
-nav_read()
-{
- QXmlStreamReader reader;
- gpsbabel::File file(read_fname);
- file.open(QIODevice::ReadOnly);
- reader.setDevice(&file);
-
- while (!reader.atEnd()) {
- if (reader.tokenType() == QXmlStreamReader::StartElement) {
- if (reader.name() == u"CacheDetails") {
- NaviReadCache(reader);
- }
- }
- reader.readNext();
- }
- if (reader.hasError()) {
- fatal(MYNAME ":Read error: %s (%s, line %ld, col %ld)\n",
- qPrintable(reader.errorString()),
- qPrintable(file.fileName()),
- (long) reader.lineNumber(),
- (long) reader.columnNumber());
- }
-}
-
-static void
-nav_rd_deinit()
-{
-}
-
-ff_vecs_t navicache_vecs = {
- ff_type_file,
- { ff_cap_read, ff_cap_none, ff_cap_none },
- nav_rd_init,
- nullptr,
- nav_rd_deinit,
- nullptr,
- nav_read,
- nullptr,
- nullptr,
- &nav_args,
- CET_CHARSET_UTF8, 0 /* CET-REVIEW */
- , NULL_POS_OPS,
- nullptr
-};
tpg tpg National Geographic Topo .tpg (waypoints)
tpo2 tpo National Geographic Topo 2.x .tpo
tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-navicache Navicache.com XML
navigonwpt Navigon Waypoints
navilink NaviGPS GT-11/BGT-11 Download
sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
file tpg tpg National Geographic Topo .tpg (waypoints)
file tpo2 tpo National Geographic Topo 2.x .tpo
file tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-file navicache Navicache.com XML
file navigonwpt Navigon Waypoints
serial navilink NaviGPS GT-11/BGT-11 Download
file sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
file rw---- tpg tpg National Geographic Topo .tpg (waypoints)
file --r--- tpo2 tpo National Geographic Topo 2.x .tpo
file r-r-r- tpo3 tpo National Geographic Topo 3.x/4.x .tpo
-file r----- navicache Navicache.com XML
file rw---- navigonwpt Navigon Waypoints
serial rwrwrw navilink NaviGPS GT-11/BGT-11 Download
file --r--- sbp sbp NaviGPS GT-31/BGT-31 datalogger (.sbp)
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tpo2.html
file r-r-r- tpo3 tpo National Geographic Topo 3.x/4.x .tpo tpo3
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_tpo3.html
-file r----- navicache Navicache.com XML navicache
- https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navicache.html
-option navicache noretired Suppress retired geocaches boolean https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navicache.html#fmt_navicache_o_noretired
-
file rw---- navigonwpt Navigon Waypoints xcsv
https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html
option navigonwpt snlen Max synthesized shortname length integer 1 https://www.gpsbabel.org/WEB_DOC_DIR/fmt_navigonwpt.html#fmt_navigonwpt_o_snlen
datum Datum (default=NAD27)
tpo2 National Geographic Topo 2.x .tpo
tpo3 National Geographic Topo 3.x/4.x .tpo
- navicache Navicache.com XML
- noretired (0/1) Suppress retired geocaches
navigonwpt Navigon Waypoints
snlen Max synthesized shortname length
snwhite (0/1) Allow whitespace synth. shortnames
+++ /dev/null
-
-<CACHEDATA>
- <CacheDetails source='NaviCache'
- cache_id='2343'
- country_code='US'
- state='AZ'
- city='Scottsdale'
- name='Eagle's Nest'
- user_name='Trail Gyspy'
- hidden_date='2002-01-30'
- modified_datetime=''
- latitude='33.5735833333333'
- longitude='-111.77645'
- difficulty='3.0'
- terrain='3.0'
- retired='no'
- cache_type='normal'
- cache_size='normal'
- handicapped='no'
- water='no'
- restrooms='no'
- parking_lot='yes'
- pets='yes'
- fees='no'
-
- comments=''
- description='Beautiful view overlooking the valley. This is a normal sized cache in an ammo can. It seems to be a popular spot so it is fairly well hidden. Please be sure to rehide it as you found it. Hope you enjoy.'
-
- cluetitle1=''
- clue1=''
- cluetitle2=''
- clue2=''
- cluetitle3=''
- clue3=''
- cluetitle4=''
- clue4=''
- cluetitle5=''
- clue5=''
- pictitle1=''
- pic1=''
- pictitle2=''
- pic2=''
- pictitle3=''
- pic3='' >
- </CacheDetails>
-
- <CacheDetails source='NaviCache'
- cache_id='2342'
- country_code='US'
- state='AZ'
- city='Camp Verde'
- name='Clear Creek Cache'
- user_name='Trail Gyspy'
- hidden_date='2002-03-11'
- modified_datetime=''
- latitude='34.51755'
- longitude='-111.769633333333'
- difficulty='2.0'
- terrain='2.5'
- retired='no'
- cache_type='normal'
- cache_size='normal'
- handicapped='no'
- water='no'
- restrooms='no'
- parking_lot='no'
- pets='yes'
- fees='no'
-
- comments=''
- description='Placed while camping with Church Youth group. Area has several "caves" that the kids loved to play in. Hike to the cache starts from either behind camp hosts campsite or from roadway, or you jump the creek if you park off the road. Cache is in a coolaid tub containing the usual cache contents. The area is visited quite often so is fairly well hidden. Please rehide so noone accidently finds it. Hint contains location description spoiler.'
-
- cluetitle1='Location Hint'
- clue1='Located about 8' up in a hole on rock wall behind a tree. Several rocks block the view from below. Easy to climb to.'
- cluetitle2=''
- clue2=''
- cluetitle3=''
- clue3=''
- cluetitle4=''
- clue4=''
- cluetitle5=''
- clue5=''
- pictitle1=''
- pic1=''
- pictitle2=''
- pic2=''
- pictitle3=''
- pic3='' >
- </CacheDetails>
-
-</CACHEDATA>
+++ /dev/null
-No,Latitude,Longitude,Name,Description,Symbol,Date,Time,URL,Type,Container,Terrain,Difficulty,Placer
-1,33.573583,-111.776450,"N00927","Eagle's Nest","Geocache-regular",2002/01/30,00:00:00,"http://www.navicache.com/cgi-bin/db/displaycache2.pl?CacheID=2343","Traditional Cache","Regular",3.0,3.0,"Trail Gyspy"
-2,34.517550,-111.769633,"N00926","Clear Creek Cache","Geocache-regular",2002/03/11,00:00:00,"http://www.navicache.com/cgi-bin/db/displaycache2.pl?CacheID=2342","Traditional Cache","Regular",2.5,2.0,"Trail Gyspy"
+++ /dev/null
-#
-# Navicache.
-#
-gpsbabel -i navicache -f ${REFERENCE}/navicache.xml -o unicsv -F ${TMPDIR}/navi.txt
-compare ${REFERENCE}/navicache~unicsv.txt ${TMPDIR}/navi.txt
remove_line $1.h GPSBabel.pro
remove_manually $1 reference/help.txt
+remove_manually $1 reference/format3.txt
# Take out the boilerplate entries in vecs.h ...
remove_line_containing extern.*$1 vecs.h
remove_line_containing Format.*$1 vecs.h
remove_line_containing include.*$1 vecs.h
-# ... then let a human nerd snip3 the actual table entry awy
+# ... then let a human nerd snip the actual table entry away.
remove_manually $1 vecs.h
remove_line_containing $1 reference/format0.txt
git rm -f xmldoc/formats/$1.xml
git rm -f xmldoc/formats/options/$1.xml
git rm -f testo.d/$1.test
-git mv $1.cc deprecated/
-git mv $1.h deprecated/
+[ -f $1.cc ] && git mv $1.cc deprecated/
+[ -f $1.h ] && git mv $1.h deprecated/
# make && ./testo
extern ff_vecs_t tpo3_vecs;
extern ff_vecs_t easygps_vecs;
extern ff_vecs_t saroute_vecs;
-extern ff_vecs_t navicache_vecs;
extern ff_vecs_t gpl_vecs;
extern ff_vecs_t text_vecs;
extern ff_vecs_t html_vecs;
LegacyFormat tpo3_fmt {tpo3_vecs};
LegacyFormat easygps_fmt {easygps_vecs};
LegacyFormat saroute_fmt {saroute_vecs};
- LegacyFormat navicache_fmt {navicache_vecs};
#if SHAPELIB_ENABLED
ShapeFormat shape_fmt;
#endif
"anr",
nullptr,
},
- {
- &navicache_fmt,
- "navicache",
- "Navicache.com XML",
- nullptr,
- nullptr,
- },
#if SHAPELIB_ENABLED
{
&shape_fmt,
+++ /dev/null
-<para>
- This is the XML format that's used by Navicache.com for
- their geocaching data. There are a number of fields in it that are
- marked "required" but are Navicache-specific, so GPSBabel can not
- write these files, but we can still read them.
- <ulink url="http://www.navicache.com/cgi-bin/ib312a/ikonboard.cgi?act=ST;f=23;t=334">navicache.com</ulink>
-</para>
-